/**fprintf dprintf sprintf*/
#include<errno.h>
#include<stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>

int main()
{
	write(1,"hello world\n",12);


	FILE *f=NULL;
	f=fopen("./test.txt","w+");
	if(NULL==f){
		perror("fopen error");
		return 1;
	}
	fprintf(f,"hello world %d\n",100);
	fprintf(stdout,"fuck the world %d\n",20000);

	dprintf(1,"hello world %d\n",100);
	dprintf(2,"fuck the world %d\n",20000);

	char buf[128]={0};
	sprintf(buf,"this is not what I want %d\n",200);
	printf("%s",buf);

	snprintf(buf,128,"fuck maga;this is not what I want %d\n",200);
	printf("%s",buf);
	return 0;
}
